#ifndef ENGRAPHICSVIEW_H
#define ENGRAPHICSVIEW_H

#include <QGraphicsView>
#include <enscene.h>
#include <enmodule.h>

class EnGraphicsView : public QGraphicsView
{
public:
    EnGraphicsView( QWidget* parent );
    EnGraphicsView();
    ~EnGraphicsView();
    void setModule( EnModule* m );

private:
    void init();
    EnModule* module;
    QPoint mouseDownPos;
    QPoint lastMouseViewPos;
    QGraphicsRectItem* selectionRect;

protected:
    void keyPressEvent( QKeyEvent *event );
    void mouseMoveEvent( QMouseEvent *event );
    void mouseReleaseEvent( QMouseEvent *event );
    void mousePressEvent( QMouseEvent *event );


protected:
    void resizeEvent( QResizeEvent *event );
};

#endif // ENGRAPHICSVIEW_H
